I would like to avoid using `.flat()` and use `.reduce` instead in JavaScript

visit shbcf.ru